package com.pengli.mytools.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.pengli.mytools.beans.po.Cities;
import com.pengli.mytools.beans.po.URLData;
import com.pengli.mytools.beans.po.User;

import com.pengli.mytools.greendao.CitiesDao;
import com.pengli.mytools.greendao.URLDataDao;
import com.pengli.mytools.greendao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig citiesDaoConfig;
    private final DaoConfig uRLDataDaoConfig;
    private final DaoConfig userDaoConfig;

    private final CitiesDao citiesDao;
    private final URLDataDao uRLDataDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        citiesDaoConfig = daoConfigMap.get(CitiesDao.class).clone();
        citiesDaoConfig.initIdentityScope(type);

        uRLDataDaoConfig = daoConfigMap.get(URLDataDao.class).clone();
        uRLDataDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        citiesDao = new CitiesDao(citiesDaoConfig, this);
        uRLDataDao = new URLDataDao(uRLDataDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(Cities.class, citiesDao);
        registerDao(URLData.class, uRLDataDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        citiesDaoConfig.clearIdentityScope();
        uRLDataDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public CitiesDao getCitiesDao() {
        return citiesDao;
    }

    public URLDataDao getURLDataDao() {
        return uRLDataDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
